//package com.ruoyi.system.hardwareAPI;
//
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//import java.io.InputStreamReader;
//import java.io.UnsupportedEncodingException;
//import java.util.HashMap;
//import java.util.Map;
//
//@RestController
//@RequestMapping("/api")
//public class HardwareOutput {
//    @Resource
//    protected HttpServletRequest request;
//    @RequestMapping(value="authentication",produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.POST)
//    @ResponseBody
//    public Map<String, Object> getString() throws UnsupportedEncodingException, IOException {
//        System.out.println("input=====================");
//        //后台接收
//        InputStreamReader reader = new InputStreamReader(request.getInputStream(), "UTF-8");
//        System.out.print(reader);
//        char[] buff = new char[1024];
//        int length = 0;
//        while ((length = reader.read(buff)) != -1) {
//            String x = new String(buff, 0, length);
//            System.out.println("x=>>>>>"+x);
//        }
//        //output
//        Map<String, Object> jsonObject = new HashMap<String, Object>(); //创建Json对象
//        jsonObject.put("username", "zhangsan");     //json bean
//        jsonObject.put("password", "123456");
//        return jsonObject;
//    }
//}
